home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / AEmaterialInfoTemplate.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  4.2 KB  |  150 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //
  20. //  Creation Date:    May 16, 1997
  21. //  Author:        sw
  22. //
  23. //  Procedure Name:
  24. //    AEmaterialInfoTemplate 
  25. //
  26. //  Description Name;
  27. //    Creates the attribute editor controls for the materialInfo  Node
  28. //
  29. //  Input Value:
  30. //    nodeName 
  31. //
  32. //  Output Value:
  33. //    None
  34. // 
  35.  
  36. global proc AEgoToMIConnected ( string $connected )
  37. {
  38.     select $connected;
  39.     editSelected;
  40. }
  41.  
  42. global proc AEshowMIConnectionsReplace ( string $shadingGroup, 
  43.                     string $material,
  44.                     string $texture )
  45. {
  46.  
  47.     string $conShadGrp[] = `listConnections $shadingGroup`;
  48.         textField -e -tx $conShadGrp[0] shadingGroupConnected;
  49.         if ($conShadGrp[0] == ""){
  50.             symbolButton -e -en 0 goToConnectedShadingGroup;
  51.         } else {
  52.             symbolButton -e -c ("AEgoToMIConnected " + $conShadGrp[0] )
  53.                 goToConnectedShadingGroup;
  54.         }
  55.     
  56.     string $conMat[] = `listConnections $material`;
  57.         textField -e -tx $conMat[0] materialConnected;
  58.         if ($conMat[0] == ""){
  59.             symbolButton -e -en 0 goToConnectedMaterial;
  60.         } else {
  61.             symbolButton -e -c ("AEgoToMIConnected " + $conMat[0] )
  62.                 goToConnectedMaterial;
  63.         }
  64.  
  65.     string $conTxt[] = `listConnections $texture`;
  66.         textField -e -tx $conTxt[0] textureConnected;
  67.         if ($conTxt[0] == ""){
  68.             symbolButton -e -en 0 goToConnectedTexture;
  69.         } else {
  70.             symbolButton -e -c ("AEgoToMIConnected " + $conTxt[0] )
  71.                 goToConnectedTexture;
  72.         }
  73.  
  74. }
  75.  
  76.  
  77. global proc AEshowMIConnectionsNew ( string $shadingGroup, 
  78.                     string $material,
  79.                     string $texture )
  80. {
  81.     setUITemplate -pst attributeEditorTemplate;
  82.  
  83.     string $conShadGrp[] = `listConnections $shadingGroup`;
  84.     rowLayout -nc 3;
  85.         text -l "Shading Group" shadingGroupName;
  86.         textField -ed 0 -tx $conShadGrp[0] shadingGroupConnected;
  87.         if ($conShadGrp[0] == ""){
  88.             symbolButton -i "inArrow.xpm" -en 0 
  89.                 goToConnectedShadingGroup;
  90.         } else {
  91.             symbolButton -i "inArrow.xpm" 
  92.                 -c ("AEgoToMIConnected " + $conShadGrp[0] )
  93.                 goToConnectedShadingGroup;
  94.         }
  95.         setParent ..;
  96.     
  97.     string $conMat[] = `listConnections $material`;
  98.     rowLayout -nc 3;
  99.         text -l "Material" materialName;
  100.         textField -ed 0 -tx $conMat[0] materialConnected;
  101.         if ($conMat[0] == ""){
  102.             symbolButton -i "inArrow.xpm" -en 0 
  103.                 goToConnectedMaterial;
  104.         } else {
  105.             symbolButton -i "inArrow.xpm" 
  106.                 -c ("AEgoToMIConnected " + $conMat[0] )
  107.                 goToConnectedMaterial;
  108.         }
  109.         setParent ..;
  110.  
  111.     string $conTxt[] = `listConnections $texture`;
  112.     rowLayout -nc 3;
  113.         text -l "Texture" textureName;
  114.         textField -ed 0 -tx $conTxt[0] textureConnected;
  115.         if ($conTxt[0] == ""){
  116.             symbolButton -i "inArrow.xpm" -en 0 
  117.                 goToConnectedTexture;
  118.         } else {
  119.             symbolButton -i "inArrow.xpm" 
  120.                 -c ("AEgoToMIConnected " + $conTxt[0] )
  121.                 goToConnectedTexture;
  122.         }
  123.         setParent ..;
  124.  
  125.     setUITemplate -ppt;
  126. }
  127.  
  128.  
  129. global proc AEmaterialInfoTemplate ( string $nodeName )
  130. {
  131.     AEswatchDisplay $nodeName;
  132.     editorTemplate -beginScrollLayout;
  133.         editorTemplate -callCustom "AEshowMIConnectionsNew" 
  134.                     "AEshowMIConnectionsReplace"
  135.                     "shadingGroup"
  136.                     "material"
  137.                     "texture";
  138.         editorTemplate -addControl "texturePlug";
  139.         editorTemplate -suppress "shadingGroup";
  140.         editorTemplate -suppress "material";
  141.         editorTemplate -suppress "texture";
  142.         editorTemplate -suppress "textureChannel";
  143.  
  144.         // include/call base class/node attributes
  145.         AEdependNodeTemplate $nodeName;
  146.  
  147.     editorTemplate -addExtraControls;
  148.     editorTemplate -endScrollLayout;
  149. }
  150.